import request from '@/utils/request'

/**
 * 为echarts绘制图形提供数据
 */
// 获取年龄结构
export function passengerAge(token) {
  return request({
    url: '/charts/passenger/age',
    method: 'get',
    params: { token }
  })
}
// 获取线路断面客流量
export function getRouteSection(token, route) {
  return request({
    url: '/charts/route/section',
    method: 'get',
    params: { token, route }
  })
}
// 获取单月客流量
export function getFlowMonth(token, year) {
  return request({
    url: '/charts/flow/month',
    method: 'get',
    params: { token, year }
  })
}
// 获取当前客流量
export function getFlowNow(query) {
  return request({
    url: '/charts/flow/now',
    method: 'get',
    params: query
  })
}
// 统计不同购票渠道
export function getAllChannel(query) {
  return request({
    url: '/charts/channel',
    method: 'get',
    params: query
  })
}
// 站点点出入的客流统计
export function getStationPoint(query) {
  return request({
    url: '/charts/flow/point',
    method: 'get',
    params: query
  })
}
// OD客流分析
export function getODData(query) {
  return request({
    url: '/charts/od',
    method: 'get',
    params: query
  })
}
// 工作日周末客流分析
export function getWeekAndWork(query) {
  return request({
    url: '/charts/week',
    method: 'get',
    params: query
  })
}
// 高峰期客流分析
export function getPeakPeriod(query) {
  return request({
    url: '/charts/peak',
    method: 'get',
    params: query
  })
}
/**
 *基础数据统计功能
 */
// 统计当前所有在站的客流量
export function getAllInStation(query) {
  return request({
    url: '/basic/in/station',
    method: 'get',
    params: query
  })
}
// 统计历史出行和当日出行总量
export function getHistoricalTravel(query) {
  return request({
    url: '/basic/historical/travel',
    method: 'get',
    params: query
  })
}
// 获取当日的运营额
export function getTodayIncome(query) {
  return request({
    url: '/basic/today/income',
    method: 'get',
    params: query
  })
}
// 进行预测
export function getPredictResult(query) {
  return request({
    url: '/predict/normal',
    method: 'get',
    params: query
  })
}
// 按照站点进行全天预测
export function getPredictStation(query) {
  return request({
    url: '/predict/station',
    method: 'get',
    params: query
  })
}
